/*
 *  水题 纸张尺寸
 * */

#include <iostream>
#include <string>

using namespace std;

int main() {
    // 请在此输入您的代码
    string n;
    cin >> n;

    int w = (int) (n[1] - '0'), temp;
    int a[2] = {1189, 841};

    for (int i = 0; i < w; ++i) {
        temp = a[0] / 2;
        a[0] = a[1];
        a[1] = temp;
    }

    cout << a[0] << endl << a[1];

    return 0;
}